package com.rem.designPattern.abstractFactory抽象工厂;


/**
 * @author Rem
 * @date 2022-11-14
 */
public class Client {
    public static void main(String[] args) {

        //创建咖啡店对象
        CoffeeStore store = new CoffeeStore();

        //创建的是意大利风味甜品工厂对象
        SnackFactory factory = new ItalySnackFactory();
        store.setFactory(factory);

        Coffee coffee = store.orderCoffee();
        Dessert dessert = store.orderDessert();

        System.out.println(coffee.getName());
        System.out.println(dessert.getName());
    }
}